﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SlimDX;
using Gype.UI;

namespace Gype.GUI.Components
{
    public class TabPage : ItemsControl
    {
        public TabPage()
        {
            Location = new System.Drawing.PointF(0, 25);
        }

        internal override void RenderObject()
        {
            if (mParentTab == null)
                return;

            mTarget.FillRectangle(new Vector2(0, 25), mParentTab.GetPageSizeFill(), BrushCollection.TabHeaderItemBackgroundSelect);

            renderChildren();
        }

        internal override void RenderTopLevel()
        {
            renderChildrenTopLevel();
        }

        internal void SetTabParent(MainTab tab)
        {
            mGUIManager = tab.mGUIManager;
            mParentTab = tab;
            mTarget = tab.mTarget;
        }

        public string Header { get; set; }

        private Rendertarget mTarget;
        private MainTab mParentTab;
        internal float TextWidth = 0;
    }
}
